//
//  NSDate+Lc.h
//  18Birdies
//
//  Created by Lc on 15/4/6.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import <Foundation/Foundation.h>//DESC
#import "Clock.h"

extern NSString* const TIMEFORMAT_STANDARD;
extern NSString* const TIMEFORMAT_STANDARD_DESC;
extern NSString* const TIMEFORMAT_STANDARD_YYTIME;
extern NSString* const TIMEFORMAT_STANDARD_DAY;
extern NSString* const TIMEFORMAT_STANDARD_MMDDYYYY;
extern NSString* const TIMEFORMAT_STANDARD_MMDDYY;
extern NSString* const TIMEFORMAT_STANDARD_MMDDYY_THUMB;
extern NSString* const TIMEFORMAT_STANDARD_TIME;
extern NSString* const TIMEFORMAT_WEATHER_MAP_TIME;

@interface NSDate (Lc)

+ (NSDate*)dateFromTimeMillis:(long long)timeMillis;

- (BOOL)isDateWillBeExpiredInOneMonth;

+ (NSDate*)nowServerTime;
+ (long long)currentTimeMillis;
+ (long long)serverTimeMillis;
+ (long long)upTimeMillis;

- (long long)timeMillis;

- (NSString*)toStringWithFormat:(NSString*)format;
- (NSString*)toStringWithFormat:(NSString *)format timeZone:(NSTimeZone*)timeZone;
- (NSString*)toStringWithFormat:(NSString *)format timeZoneId:(NSString*)timeZoneId;
+ (NSDate*)dateFromString:(NSString*)dateString andFormat:(NSString*)format;
+ (NSDate*)dateFromString:(NSString*)dateString andFormat:(NSString*)format timeZone:(NSTimeZone*)timeZone;
+ (NSDate*)dateFromString:(NSString*)dateString andFormat:(NSString*)format timeZoneId:(NSString*)timeZoneId;

- (BOOL)isSameDayWithDate:(NSDate*)anotherDate;
- (BOOL)isSameDayWithDate:(NSDate*)anotherDate timeZoneId:(NSString*)timeZoneId;
- (BOOL)isSameDayWithDate:(NSDate*)anotherDate timeZone:(NSTimeZone*)timeZone;

- (NSString*)standardFormatString;
- (NSString*)standardFormatString_desc;
- (NSString*)standardFormatYYTIMEString;
- (NSString*)standardMMDDYYYYFormatString;
- (NSString*)standardMMDDYYFormatString;
- (NSString*)standardMMDDYYThumbFormatStringWithTimeZone:(NSTimeZone*)timeZone;
- (NSString*)standardMMDDYYThumbFormatStringWithTimeZoneId:(NSString*)timeZoneId;
- (NSString*)standardDayFormatString;
- (NSString*)standardDayThumbFormatString;
- (NSString*)autoStandardDayFormatString;
- (NSString*)timeLeftString;
- (NSString*)weatherMapTimeString;

+ (NSString*)weekDay:(long long)temstamp;
+ (NSString*)month:(long long)temstamp;
+ (NSString*)day:(long long)temstamp;
+ (NSString*)monthDay:(long long)temstamp;

// duration: seconds
+ (NSString*)minWithDuration:(double)duration;

@end
